package jwr.model;

public class SungJukVO {
	private String name;
	private int kor;
	private int eng;
	private int mat;
	
	private int tot;
	private double avg;
	private char grd;
	public SungJukVO() {
	}
	public SungJukVO(String name, int kor, int eng, int mat) {
		this.name = name;
		this.kor = kor;
		this.eng = eng;
		this.mat = mat;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getKor() {
		return kor;
	}
	public void setKor(int kor) {
		this.kor = kor;
	}
	public int getEng() {
		return eng;
	}
	public void setEng(int eng) {
		this.eng = eng;
	}
	public int getMat() {
		return mat;
	}
	public void setMat(int mat) {
		this.mat = mat;
	}
	public int getTot() {
		return tot;
	}
	public void setTot() {
		tot = kor+eng+mat;
	}
	public double getAvg() {
		return avg;
	}
	public void setAvg(double avg) {
		avg = tot/3;
	}
	public char getGrd() {
		return grd;
	}
	public void setGrd(char grd) {
		switch ((int)(avg/10))
		{
			case 10:
			case 9: { 
				grd='수'; 
				break;
			}
			case 8: {
				grd = '우'; 
				break;
			}
			case 7: { 
				grd = '미'; 
				break;
			}
			case 6: { 
				grd = '양'; 
				break;
			}
			default:{
				grd = '가';
			}
		}
	}
	@Override
	public String toString() {
		return "SungJukVO [name=" + name + ", kor=" + kor + ", eng=" + eng
				+ ", mat=" + mat + ", tot=" + tot + ", avg=" + avg + ", grd="
				+ grd + "]";
	}
	
	
	
}
